#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
using namespace std;

class TextQuey
{
public:
    TextQuey(){
        _lines.reserve(107);
    }

    void readFlie(const string filename);

    void dealLine(string & line);

    void query(const string & word);

private:
    vector<string> _lines;
    map<string,set<int>> _wordNumbers;
    map<string,int> _dict;
};

void TextQuey::readFlie(const string filename){
    ifstream ifs(filename);
    if(!ifs){
        cerr << "ifstream open file failed" << endl;
        return;
    }

    string line;
    size_t lineNumber = 1;
    while(getline(ifs,line)){
        _lines.push_back(line);
        dealLine(line);
        istringstream iss(line);
        string word;
        while(iss >> word){
            ++_dict[word];
            _wordNumbers[word].insert(lineNumber);
        }
        ++lineNumber;
    }

}

void test0(){

}

int main(int argc, char * argv[])
{
    test0();
    return 0;
}


